package com.itheima.web.request;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 1.继承HttpServlet
 * 2.重写doXXX
 * 3.编写访问路径
 */
@WebServlet("/req5")
public class RequestDemo5 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("RequestDemo5......");
        // 请求转发到6 / 开头是应用程序内容部转发，故 / 就是Servlet里面路径 /
        // forward 转发
        // 核酸检测，读取二维码信息（读取是名字)
        req.setAttribute("name","zhangsan");
        req.getRequestDispatcher("/req6").forward(req,resp);
    }
}
